#include "demuxerthread.h"
#include "demuxer.h"
DemuxerThread::DemuxerThread(QObject *parent) : QThread(parent)
{

    connect(this,&QThread::finished,this,&QThread::deleteLater);
}

DemuxerThread::~DemuxerThread()
{

    disconnect();

    requestInterruption();

    quit();

    wait();

    qDebug() << "DemuxerThread destroy";
}

void DemuxerThread::run()
{

    Demuxer demuxer;

    YUVFileSpec yuvFileSpec(0,0,0,AV_PIX_FMT_NONE,"/Users/tgy/Documents/ffmpeg/video/demuxer_demo02.yuv");
    PCMFileSpec pcmFileSpec(0,0,AV_SAMPLE_FMT_NONE,"/Users/tgy/Documents/ffmpeg/video/demuxer_demo02.pcm");

    demuxer.demuxer("/Users/tgy/Documents/ffmpeg/video/demo02.mp4",yuvFileSpec,pcmFileSpec);

    qDebug() << yuvFileSpec.getWidth() << yuvFileSpec.getHeight();

    qDebug() << pcmFileSpec.getSampleRate() << pcmFileSpec.getFormat();

}


